package com.yanqu.road.server.pb;

import com.yanqu.road.entity.activity.newyearbag.NewYearBagConfig;
import com.yanqu.road.entity.activity.newyearbag.NewYearBagDrawConfig;
import com.yanqu.road.pb.activity.NewYearBagProto;

public class NewYearBagPb {

    public static NewYearBagProto.NewYearBagSyncConfigRespMsg.Builder parseNewYearBagSyncConfigRespMsg(NewYearBagConfig config) {
        NewYearBagProto.NewYearBagSyncConfigRespMsg.Builder builder = NewYearBagProto.NewYearBagSyncConfigRespMsg.newBuilder();
        for (NewYearBagDrawConfig drawConfig : config.getDrawConfigList()) {
            builder.addDrawConfig(parseNewYearBagDrawConfigMsg(drawConfig));
        }
        return builder;
    }

    public static NewYearBagProto.NewYearBagDrawConfigMsg.Builder parseNewYearBagDrawConfigMsg(NewYearBagDrawConfig config) {
        NewYearBagProto.NewYearBagDrawConfigMsg.Builder builder = NewYearBagProto.NewYearBagDrawConfigMsg.newBuilder();
        builder.setRewardId(config.getRewardId());
        builder.setRewardType(config.getRewardType());
        builder.setReward(config.getReward());
        builder.setIsBig(config.getIsBigAward());
        return builder;
    }

}
